package com.zaixiandiancan.xia.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SessionConfiguration implements WebMvcConfigurer {

    public void addInterceptors(InterceptorRegistry registry ){
        //网站配置生成器：添加一个拦截器，拦截路径为整个项目
        registry.addInterceptor(new SessionInterceptor()).addPathPatterns("/")
                .excludePathPatterns("/login", "/login_index", "/getGoods", "/getPay", "/getPays", "/getOrders", "/cleanCookie", "getCookie");
    }
}
